<script type="text/javascript" src="<?php echo $this->baseUrl() ?>/public/js/jquery.md5.js"></script>

<?php echo $this->inlineScript()->setScript('
	$(document).ready(function(){
		$.validator.setDefaults({
			submitHandler: function(e) { 
				var fields = $(e).find( "input.style1" );
				
				$("#login-form").animate({
					opacity: 0
				});
				
				$.post(
					baseUrl + "/index/login",
					{
						login : $( fields[0] ).val(),
						password : $.md5( $( fields[1] ).val() ),
						json : true
					},
					function( resp ){
						if( resp.status ) {
							window.location.href = "' . $this->ref . '";
						} else {
							alert( "' . $this->translate( 'error_login' ) . '" );
							$("#login-form").animate({
								opacity: 1
							});
						}
					},
					"json"
				);
			}
		});
	
		$("#login-form").validate({
			rules: {
				email : {
					required: true,
					email: true
				},
				pass : {
					required: true,
					minlength: 2
				}
			},
			messages: {
				email : "' . $this->translate( 'error_email' ) . '",
				pass : "'. $this->translate( 'error_password' ) .'"
			}
		});
	});
	') ?>
<h2 class="bold"><?php echo $this->translate( 'your_basket' ) ?></h2>

<div class="content">
	<div class="acenter">
		<form id="login-form" onsubmit="return false" method="post" action="">
		<p class="mtop20"><input type="text" id="cemail" name="email" class="style1 acenter" style="width:250px" value="<?php echo $this->translate( 'basket_login' ); ?>"  onfocus="if(this.value=='<?php echo $this->translate( 'basket_login' ); ?>')this.value=''" onblur="if(this.value=='')this.value='<?php echo $this->translate( 'basket_login' ); ?>'"></p>
		<p class="mtop10"><input type="password" id="cpass" name="pass" class="style1 acenter" style="width:250px" value="<?php echo $this->translate( 'basket_pass' ); ?>" onfocus="if(this.value=='<?php echo $this->translate( 'basket_pass' ); ?>')this.value=''" onblur="if(this.value=='')this.value='<?php echo $this->translate( 'basket_pass' ); ?>'"></p>
		<p class="mtop10"><input type="submit" class="button3" value="<?php echo $this->translate( 'basket_loged' ) ?>"></p>
		</form>
		
		<div  class="mtop10">
		<a href="<?php echo $this->baseUrl() ?>/index/newaccount" class="cyellow" style="margin:0 10px"><?php echo $this->translate( 'basket_newaccount' ) ?></a>
		<a href="<?php echo $this->baseUrl() ?>/index/remindpass" style="margin:0 10px"><?php echo $this->translate( 'basket_remind' ) ?></a>
		</div>
	</div>
</div>